#pragma once
#include "..\interfaces\idataadapter.h"
#include "..\Libs\TinyXml\tinyxml.h"


class CXmlAdapter :
	public IDataAdapter
{
public:
	CXmlAdapter(void);
	~CXmlAdapter(void);
	BOOL InitInstance(){return TRUE;}
	BOOL IsInit(){return TRUE;}
	BOOL ExecCommand(LPCSTR Command,StringArray& vctValue);
	BOOL CreateStorage(LPCSTR Path,int OpType);
	BOOL SaveStorage();
public:
	BOOL LocalePath(LPCSTR Path);
	BOOL LocaleIndex(int Index);
protected:
	TiXmlNode* FindNode(string& NodeName,BOOL Create=TRUE);
protected:
	TiXmlDocument m_Document;
	vector<TiXmlNode*> m_Elements;
	TiXmlNode* m_pElement;
	CStringA m_sFilePath;
};
